package com.teaching.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * spring boot配置了拦截器，拦截器的配置把默认处理静态资源的配置给覆盖了
 * 需要重写  addResourceHandlers
 *
 * @author xubb
 * @Description
 * @create 2021-03-22 13:46
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/**")
                .addResourceLocations("classpath:/static/");
//                .addResourceLocations("classpath:/templates/");
    }

}
